<template>
  <div class="app-container">
    <!-- 导航栏部分 -->

    <!-- 搜索框部分 -->
    <div
      class="search-container"
      :class="{ scrolled: isScrolled, hidden: isHidden }"
    >
      <div class="search-wrapper" align="center">
        <SearchBar @search="handleSearch" />
      </div>
    </div>

    <!-- 主体内容部分 -->
    <div class="main-content">
      <!-- 三级分类区块 -->
      <div
        class="job-categories-container"
        @mouseleave="handleGlobalMouseLeave"
      >
        <div class="categories-wrapper">
          <!-- 左侧一级分类 -->
          <div class="left-categories" @mouseenter="handleCategoryMouseEnter">
            <div
              v-for="(level1, index1) in categories"
              :key="level1.id || index1"
              class="level1-group"
            >
              <div
                class="level1-title"
                @mouseenter="handleLevel1MouseEnter(level1)"
                @click="toggleLevel2(level1)"
                :class="{ active: isLevel1Active(level1) }"
              >
                <span class="level1-icon">
                  <i :class="level1.icon || 'fa fa-briefcase'"></i>
                </span>
                <span class="level1-name">{{ level1.name }}</span>
                <span class="arrow" :class="{ rotate: level1.isOpen }">
                  <i class="fa fa-angle-right"></i>
                </span>
              </div>
            </div>
          </div>

          <!-- 中间二级分类 -->
          <div
            v-if="currentLevel1?.isOpen"
            class="middle-categories"
            @mouseenter="handleCategoryMouseEnter"
          >
            <div
              v-for="(level2, index2) in currentLevel1.children"
              :key="level2.id || index2"
              class="level2-item"
              @mouseenter="handleLevel2MouseEnter(level2)"
              @click="toggleLevel3(level2)"
              :class="{ active: currentLevel2?.id === level2.id }"
            >
              <span class="level2-name">{{ level2.name }}</span>
              <span class="arrow" :class="{ rotate: level2.isOpen }">
                <i class="fa fa-angle-right"></i>
              </span>
            </div>
          </div>

          <!-- 右侧内容区域 -->
          <div class="right-content">
            <div v-if="loading" class="loading-content">
              <div class="loading-spinner"></div>
              <p>加载中，请稍候...</p>
            </div>

            <div v-if="error" class="error-content">
              <i class="fa fa-exclamation-circle"></i>
              <p>{{ error }}</p>
            </div>

            <div v-if="searchResult" class="search-result">
              <div class="search-header">
                <h2 class="search-title">搜索结果: "{{ searchKeyword }}"</h2>
                <span class="result-count"
                  >{{ searchResult.length }} 个职位</span
                >
              </div>
              <div class="search-results-grid">
                <a
                  v-for="(job, index) in searchResult"
                  :key="index"
                  :href="`/jobs/${job.id}`"
                  class="search-result-card"
                >
                  <div class="job-title">{{ job.title }}</div>
                  <div class="company-name">{{ job.company }}</div>
                  <div class="salary">{{ job.salary }}</div>
                </a>
              </div>
            </div>

            <div v-if="currentLevel2 && !searchResult" class="content-inner">
              <div class="content-header">
                <div class="breadcrumb">
                  <span class="breadcrumb-item" @click="backToLevel1">{{
                    currentLevel1?.name || "全部职位"
                  }}</span>
                  <span class="breadcrumb-separator">/</span>
                  <span class="breadcrumb-item active">{{
                    currentLevel2.name
                  }}</span>
                </div>
                <h2 class="content-title">{{ currentLevel2.name }}</h2>
                <div class="level2-info">
                  <span
                    >{{ currentLevel2.children?.length || 0 }} 个细分领域</span
                  >
                  <span class="divider">|</span>
                  <span>查看全部职位</span>
                </div>
              </div>

              <div class="level3-grid">
                <a
                  v-for="(level3, index3) in currentLevel2.children"
                  :key="level3.id || index3"
                  :href="getJobLink(level3)"
                  class="level3-card"
                >
                  <div class="level3-name-only">{{ level3.name }}</div>
                </a>
              </div>
            </div>

            <!-- 仅当鼠标未悬停且未选择分类时显示图片 -->
            <!-- 修改图片区域代码 -->
            <div v-if="shouldShowImages && !searchResult" class="image-grid">
              <div class="image-row">
                <div class="image-item">
                  <a :href="imageLinks[0]" target="_blank">
                    <img :src="img1" alt="图片1" />
                  </a>
                </div>
                <div class="image-item">
                  <a :href="imageLinks[1]" target="_blank">
                    <img :src="img2" alt="图片2" />
                  </a>
                </div>
              </div>
              <div class="image-row">
                <div class="image-item">
                  <a :href="imageLinks[2]" target="_blank">
                    <img :src="img3" alt="图片3" />
                  </a>
                </div>
                <div class="image-item">
                  <a :href="imageLinks[3]" target="_blank">
                    <img :src="img4" alt="图片4" />
                  </a>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>

      <!-- 热招职位区块 -->
      <div class="section-container jobs-section">
        <div class="section-header">
          <h2 class="section-title">热招职位</h2>
          <p class="section-subtitle">最新高薪职位推荐</p>
        </div>

        <div class="category-nav">
          <el-button
            v-for="(category, index) in firstLevelCategories"
            :key="index"
            @click="handleCateOneClick(category)"
            :class="[
              'category-btn',
              activeCategoryId === category.id ? 'active' : '',
            ]"
            type="primary"
            plain
          >
            {{ category.name }}
          </el-button>
        </div>

        <div v-if="loading" class="loading">
          <el-skeleton :rows="3" animated></el-skeleton>
        </div>

        <div v-if="error" class="error">
          <el-alert type="error" :title="error"></el-alert>
        </div>

        <div
          v-if="
            !loading && !error && (!jobpostings || jobpostings.length === 0)
          "
          class="empty-state"
        >
          <el-empty description="暂无相关职位信息"></el-empty>
        </div>

        <div class="job-list" v-if="jobpostings && jobpostings.length > 0">
          <div
            v-for="(job, index) in jobpostings"
            :key="index"
            class="job-card"
            @mouseenter="handleMouseEnter(index)"
            @mouseleave="handleMouseLeave(index)"
          >
            <div class="job-info">
              <div class="job-header">
                <h3 class="job-title">{{ job.title }}</h3>
                <span class="salary">{{ job.money }}</span>
              </div>
              <div class="job-meta">
                <span
                  ><el-icon><location /></el-icon>{{ job.city.name }}</span
                >
                <span>{{ job.label }}</span>
                <span
                  ><el-icon><school /></el-icon>{{ job.education }}</span
                >
                <el-icon v-if="job.tags && job.tags.length > 0"
                  ><collection-tag
                /></el-icon>
                <span v-if="job.labels && job.labels.length > 0">{{
                  job.labels.join(" ")
                }}</span>
              </div>
              <div class="company-info">
                <img
                  :src="job.company.logo || 'https://picsum.photos/100/100'"
                  alt="Company Logo"
                  class="company-logo"
                />
                <div class="company-details">
                  <div class="company-name">{{ job.company.name }}</div>
                  <div class="job-meta">{{ job.company.description }}</div>
                </div>
              </div>
            </div>
            <div
              class="job-actions"
              :class="{ 'show-actions': isHoveringIndex === index }"
            >
              <el-button size="small" type="primary" plain>详情</el-button>
              <el-button size="small" type="warning" plain>收藏</el-button>
            </div>
          </div>
        </div>

        <div class="global-btn-container">
          <button class="global-view-more" @click="gotoJobList">
            查看更多
          </button>
        </div>
      </div>

      <!-- 热门企业区块 -->
      <div class="section-container company-section">
        <div class="section-header">
          <h2 class="section-title">热门企业</h2>
          <p class="section-subtitle">知名企业正在招聘</p>
        </div>

        <div class="company-grid">
          <div
            v-for="company in companies"
            :key="company.id"
            class="company-card"
          >
            <!-- 企业信息部分 -->
            <div class="company-info">
              <img
                :src="company.logo || 'https://picsum.photos/40/40'"
                alt="企业Logo"
                class="company-logo"
              />
              <div>
                <h2 class="company-name">{{ company.name }}</h2>
                <div class="company-tags">
                  <span>
                    <template v-if="company.is_listed === 0">未融资</template>
                    <template v-else-if="company.is_listed === 1"
                      >天使轮</template
                    >
                    <template v-else-if="company.is_listed === 2">A轮</template>
                    <template v-else-if="company.is_listed === 3">B轮</template>
                    <template v-else-if="company.is_listed === 4">C轮</template>
                    <template v-else-if="company.is_listed === 5"
                      >D轮及以上</template
                    >
                    <template v-else-if="company.is_listed === 6"
                      >已上市</template
                    >
                    <template v-else-if="company.is_listed === 7"
                      >不需要融资</template
                    >
                    <template v-else>未标注</template>
                  </span>
                  <span>{{ company.employee_number || "未标注" }}</span>
                  <span>{{ company.description || "未标注" }}</span>
                </div>
              </div>
            </div>
            <!-- 职位列表 -->
            <div class="job-list">
              <div
                v-for="job in company.job_list"
                :key="job.id"
                class="job-item"
              >
                <div class="job-header">
                  <h3 class="job-title">{{ job.title }}</h3>
                  <span class="job-salary">{{ job.money }}</span>
                </div>
                <div class="job-meta">
                  <span>{{
                    formatAddress(job.location_name) || "未知城市"
                  }}</span>
                  <span>{{ job.experience || "经验不限" }}</span>
                  <span>{{ job.education || "学历不限" }}</span>
                </div>
              </div>
            </div>
            <div class="btn-container">
              <button class="view-more-btn">查看更多职位</button>
            </div>
          </div>
        </div>

        <div class="global-btn-container">
          <button class="global-view-more" @click="gotoCompanyList">
            查看更多企业
          </button>
        </div>
      </div>
    </div>
  </div>
</template>
<script setup>
import { ref, computed, onMounted, watch, onUnmounted } from "vue";
import { useRoute } from "vue-router";
import axios from "axios";
import CitySelector from "../components/CitySelector.vue";
import SearchBar from "../components/SearchBar.vue";
import { Location, School, CollectionTag } from "@element-plus/icons-vue";
import {
  ElEmpty,
  ElSkeleton,
  ElTag,
  ElButton,
  ElIcon,
  ElAlert,
} from "element-plus";
import img1 from "./img/homehua1.png";
import img2 from "./img/homehua2.png";
import img3 from "./img/homehua3.png";
import img4 from "./img/homehua4.png";
import router from "@/router/index.js";
import sessionManager from "@/utils/session.js";

const route = useRoute();

// 会话验证函数
const validateSession = async () => {
  const sessionId = route.query.session;
  if (sessionId) {
    try {
      // 使用会话管理工具验证会话
      const result = await sessionManager.validateSession(sessionId);

      if (result.success) {
        // 会话有效，更新localStorage中的用户信息
        sessionManager.updateUserData(result.userData);

        // 清除URL中的session参数，重定向到干净的URL
        router.replace("/home");
        return true;
      } else {
        // 会话无效，重定向到登录页
        console.error("会话验证失败:", result.error);
        router.replace("/");
        return false;
      }
    } catch (error) {
      console.error("会话验证请求失败:", error);
      router.replace("/");
      return false;
    }
  }
  return true; // 没有session参数，继续正常流程
};

// 图片链接
const imageLinks = ref([
  "https://www.bytedance.com/zh/",
  "https://supplier.alibaba.com/landing/sem.htm?&joinSource=gw_bing_LP_003&msclkid=310ba12afa461ee4b252c94e56eb2460",
  "https://www.ikea.cn/cn/zh/cat/62094/",
  "https://passport.meituan.com/account/unitivelogin",
]);

// 导航栏相关数据
const currentCity = ref("北京");
const showSelector = ref(false);
const activeNav = ref("home");
const unreadCount = ref(3);
const showMessageTip = ref(false);
const showResumeMenu = ref(false);
const showUserMenu = ref(false);

// 职位分类相关数据
const categories = ref([]);
const loading = ref(false);
const error = ref(null);
const currentLevel1 = ref(null);
const currentLevel2 = ref(null);
const hoverTimer = ref(null);
const hoverDelay = 300;
const isHovering = ref(false);

// 搜索相关数据
const searchKeyword = ref("");
const searchResult = ref(null);

// 热招职位相关数据
const firstLevelCategories = ref([]);
const activeCategoryId = ref(null);
const jobpostings = ref([]);
const isHoveringIndex = ref(-1);
const total = ref(0);

// 热门企业相关数据
const companies = ref([]);

// 滚动相关数据
const isScrolled = ref(false);
const isHidden = ref(false);
const lastScrollPosition = ref(0);

// 地址格式化函数
const formatAddress = (address) => {
  if (!address) return "";
  const municipalityReg = /^(北京|上海|天津|重庆)市?/;
  if (municipalityReg.test(address)) {
    const match = address.match(/^(北京|上海|天津|重庆)市?([^区]+区|[^县]+县)/);
    return match ? `${match[1]}市 ${match[2]}` : address;
  }
  const provinceReg =
    /^([^省]+省|.+自治区|.+特别行政区)([^市]+市)([^区]+区|[^县]+县)/;
  const match = address.match(provinceReg);
  if (match) {
    return `${match[1]} ${match[2]} ${match[3]}`;
  }
  return address;
};

// 滚动处理函数
const handleScroll = () => {
  const currentScrollPosition = window.scrollY || window.pageYOffset;

  if (currentScrollPosition > 50) {
    isScrolled.value = true;

    if (currentScrollPosition > lastScrollPosition.value) {
      isHidden.value = true;
    } else {
      isHidden.value = false;
    }
  } else {
    isScrolled.value = false;
    isHidden.value = false;
  }

  lastScrollPosition.value = currentScrollPosition;
};

// 获取一级分类
const fetchFirstLevelCategories = async () => {
  loading.value = true;
  try {
    const response = await axios.get("http://127.0.0.1:8000/home/JobCateOne/");
    if (response.data.code === 200) {
      firstLevelCategories.value = response.data.data;
      if (firstLevelCategories.value.length > 0) {
        activeCategoryId.value = firstLevelCategories.value[0].id;
        handleCateListClick(activeCategoryId.value);
      }
    } else {
      error.value = response.data.msg || "获取分类数据失败";
    }
  } catch (err) {
    error.value = "网络异常，请重试";
    console.error("请求分类树失败：", err);
  } finally {
    loading.value = false;
  }
};
// 点击更多跳转列表职位页
const gotoJobList = () => {
  router.push("/joblist");
};

// 获取热招职位列表
const handleCateListClick = async (categoryId) => {
  loading.value = true;
  error.value = "";
  try {
    const response = await axios.get(
      "http://127.0.0.1:8000/home/jobcateList/",
      {
        params: {
          jobcate_id: categoryId,
        },
      }
    );
    console.log("452", response);
    if (response.data.code === 200) {
      console.log("453", response);
      let data = response.data.data.results || response.data.data;
      data = data.slice(0, 9);
      jobpostings.value = data;
      total.value = data.length;
    } else {
      console.log("459", response);
      error.value = response.data.error || "获取招聘信息失败";
      jobpostings.value = [];
    }
  } catch (err) {
    error.value = "网络异常，请重试";
    jobpostings.value = [];
    console.error("请求招聘信息失败：", err);
  } finally {
    loading.value = false;
  }
};

const handleCateOneClick = (category) => {
  activeCategoryId.value = category.id;
  handleCateListClick(category.id);
  const jobList = document.querySelector(".job-list");
  if (jobList) jobList.scrollIntoView({ behavior: "smooth" });
};

const handleMouseEnter = (index) => {
  isHoveringIndex.value = index;
};

const handleMouseLeave = () => {
  isHoveringIndex.value = -1;
};

// 获取热门企业
const fetchHotCompanies = async () => {
  try {
    const response = await axios.get("http://127.0.0.1:8000/home/hot_job/");
    companies.value = response.data.data || [];
  } catch (error) {
    console.error("Error fetching hot companies:", error);
    error.value = "加载热门企业失败";
  }
};

// 获取分类数据
const fetchCategories = async () => {
  try {
    loading.value = true;
    error.value = null;
    const response = await axios.get(
      "http://127.0.0.1:8000/home/job-categories/"
    );

    if (response.data && Array.isArray(response.data)) {
      categories.value = response.data.map((level1) => ({
        ...level1,
        isOpen: false,
        icon: level1.icon || "fa fa-briefcase",
        children:
          level1.children?.map((level2) => ({
            ...level2,
            isOpen: false,
            icon: level2.icon || "fa fa-code",
            children: level2.children || [],
          })) || [],
      }));
    } else {
      throw new Error("API返回的数据格式不正确");
    }
  } catch (err) {
    error.value =
      "加载职位分类失败: " + (err.response?.data?.message || err.message);
    console.error("加载失败:", err);
  } finally {
    loading.value = false;
  }
};

// 处理搜索
const handleSearch = (keyword) => {
  searchKeyword.value = keyword;
  if (!keyword.trim()) {
    searchResult.value = null;
    return;
  }

  loading.value = true;
  setTimeout(() => {
    searchResult.value = [
      {
        id: 1,
        title: `前端开发工程师 (${keyword})`,
        company: "字节跳动",
        salary: "15-30K·14薪",
      },
      {
        id: 2,
        title: `后端开发工程师 (${keyword})`,
        company: "腾讯科技",
        salary: "20-40K·15薪",
      },
      {
        id: 3,
        title: `UI设计师 (${keyword})`,
        company: "阿里巴巴",
        salary: "12-25K·13薪",
      },
      {
        id: 4,
        title: `产品经理 (${keyword})`,
        company: "百度",
        salary: "18-35K·14薪",
      },
    ];
    loading.value = false;
  }, 800);
};

// 处理全局鼠标离开（离开整个组件）
const handleGlobalMouseLeave = () => {
  isHovering.value = false;
  resetSelection();
};

// 处理分类区域鼠标进入
const handleCategoryMouseEnter = () => {
  isHovering.value = true;
};

// 处理一级分类鼠标进入
const handleLevel1MouseEnter = (level1) => {
  if (hoverTimer.value) clearTimeout(hoverTimer.value);

  hoverTimer.value = setTimeout(() => {
    if (!level1.isOpen) {
      categories.value.forEach((item) => (item.isOpen = false));
      level1.isOpen = true;
      currentLevel1.value = level1;
      if (level1.children?.length) currentLevel2.value = level1.children[0];
    }
    hoverTimer.value = null;
  }, hoverDelay);
};

// 处理二级分类鼠标进入
const handleLevel2MouseEnter = (level2) => {
  if (hoverTimer.value) clearTimeout(hoverTimer.value);

  hoverTimer.value = setTimeout(() => {
    currentLevel2.value = level2;
    hoverTimer.value = null;
  }, hoverDelay);
};

// 重置选择状态
const resetSelection = () => {
  if (hoverTimer.value) clearTimeout(hoverTimer.value);

  hoverTimer.value = setTimeout(() => {
    if (currentLevel1.value) {
      currentLevel1.value.isOpen = false;
      currentLevel1.value = null;
      currentLevel2.value = null;
    }
    hoverTimer.value = null;
  }, hoverDelay);
};

// 点击一级分类
const toggleLevel2 = (level1) => {
  if (level1.isOpen && currentLevel1.value?.id === level1.id) {
    level1.isOpen = false;
    currentLevel1.value = null;
    currentLevel2.value = null;
  } else {
    categories.value.forEach((item) => (item.isOpen = false));
    level1.isOpen = true;
    currentLevel1.value = level1;
    if (level1.children?.length) currentLevel2.value = level1.children[0];
  }
};

// 点击二级分类
const toggleLevel3 = (level2) => {
  if (currentLevel2.value?.id === level2.id) {
    currentLevel2.value = null;
  } else {
    currentLevel2.value = level2;
  }
};

// 判断一级分类是否激活
const isLevel1Active = (level1) => {
  return currentLevel1.value?.id === level1.id;
};

// 返回一级分类
const backToLevel1 = () => {
  currentLevel2.value = null;
};

// 生成职位链接
const getJobLink = (job) => {
  return `/jobs?category=${job.id}&name=${encodeURIComponent(job.name)}`;
};

// 用户菜单切换
const toggleUserMenu = () => {
  showUserMenu.value = !showUserMenu.value;
};

// 城市选择回调
const onSelectCity = (city) => {
  currentCity.value = city;
};

// 计算属性：是否应该显示图片
const shouldShowImages = computed(() => {
  return (
    !isHovering.value && !currentLevel2.value && !loading.value && !error.value
  );
});

// 页面跳转函数
const gotoCompanyList = () => {
  // 这里可以添加跳转到公司列表页的逻辑
  console.log("跳转到公司列表页");
  router.push("/companyList");
};

// 组件挂载时获取数据
onMounted(async () => {
  // 首先验证会话
  const sessionValid = await validateSession();
  if (!sessionValid) {
    return; // 如果会话无效，已经重定向到登录页
  }

  // 会话验证通过后，加载页面数据
  fetchCategories();
  fetchFirstLevelCategories();
  fetchHotCompanies();
  window.addEventListener("scroll", handleScroll);
});

// 组件卸载时移除事件监听
onUnmounted(() => {
  window.removeEventListener("scroll", handleScroll);
});

// 监听活跃分类变化，切换时自动加载职位
watch(activeCategoryId, (newId) => {
  if (newId) {
    handleCateListClick(newId);
  }
});
</script>
<style scoped>
/* 全局样式变量 */
:root {
  --primary-color: #00bebd;
  --secondary-color: #ff7d00;
  --text-primary: #333;
  --text-secondary: #666;
  --text-tertiary: #999;
  --bg-light: #f5f7fa;
  --bg-white: #ffffff;
  --border-color: #e1e4e8;
  --hover-bg: #ebf0f5;
  --search-bg: #f0f2f5;
}

/* 应用容器 */
.app-container {
  background: linear-gradient(to bottom, #dbeff2 1%, #ffffff 100%);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding-top: 50px; /* 让内容刚好被头部导航压住一点 */
}

/* 导航栏样式 */
.boss-header {
  background-color: #202329;
  color: white;
  height: 50px;
  position: sticky;
  top: 0;
  z-index: 100;
  background-image: url("https://img.bosszhipin.com/static/zhipin/geek/982401352937125536.png.webp");
  background-size: 100% 49px;
  background-repeat: no-repeat;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
/* 统一区块样式 */
.section-container {
  max-width: 1500px;
  margin: 0 auto 10px;
  padding: 10px;
  margin-top: 20px;
  background: white;
  border-radius: 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.section-container:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #00bebd, #00b26a);
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* 三级分类区块特殊样式 */
.category-section {
  background: linear-gradient(135deg, #f9fcff 0%, #f0f7fa 100%);
}

/* 热招职位区块特殊样式 */
.jobs-section {
  background: linear-gradient(135deg, #fff9f8 0%, #e5efdf 100%);
}

/* 热门企业区块特殊样式 */
.company-section {
  background: linear-gradient(135deg, #f8fff9 0%, #f0faf5 100%);
}

/* 响应式调整 */
@media (max-width: 992px) {
  .section-container {
    padding: 30px;
    margin-bottom: 30px;
  }

  .section-title {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .section-container {
    padding: 24px;
    margin-bottom: 24px;
    border-radius: 12px;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .section-subtitle {
    font-size: 1rem;
  }
}
.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 20px;
}

.logo a {
  color: #00bebd;
  font-size: 22px;
  font-weight: bold;
  text-decoration: none;
  margin-right: 30px;
}

.city-selector-btn {
  position: relative;
  margin-right: 30px;
  cursor: pointer;
  padding: 0 10px;
  height: 100%;
  display: flex;
  align-items: center;
}

.city-selector-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.location-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23FFFFFF"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/></svg>');
  background-repeat: no-repeat;
  margin-right: 5px;
}

.current-city {
  font-size: 14px;
  color: #ffffff;
}

.switch-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-left: 4px;
}

.main-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav li {
  margin: 0 10px;
  position: relative;
}

.main-nav a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 14px;
  padding: 15px 5px;
  display: inline-block;
  transition: all 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
  color: #ffffff;
  font-weight: 500;
}

.combo-item {
  display: flex;
  align-items: center;
}

.divider {
  color: rgba(255, 255, 255, 0.3);
  margin: 0 2px;
}

.user-area {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.message-box {
  position: relative;
}

.message-btn {
  display: flex;
  align-items: center;
  position: relative;
}

.message-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23FFFFFF"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"/></svg>');
  background-repeat: no-repeat;
}

.message-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #ff4d4f;
  color: white;
  font-size: 12px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 8px;
  padding: 0 3px;
}

.message-tip {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  padding: 8px 12px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  color: #333;
  font-size: 12px;
  white-space: nowrap;
  margin-top: 10px;
}

.message-tip .tip-arrow {
  position: absolute;
  bottom: 100%;
  right: 10px;
  border-width: 0 6px 6px;
  border-style: solid;
  border-color: transparent transparent white;
}

.resume-box {
  position: relative;
}

.resume-btn {
  color: white;
  font-size: 14px;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.resume-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.resume-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  min-width: 160px;
  z-index: 10;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  color: #333;
  font-size: 14px;
  text-decoration: none;
}

.menu-item:hover {
  background-color: #f5f5f5;
}

.resume-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  background-repeat: no-repeat;
}

.edit-icon {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23333333"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>');
}

.upload-icon {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23333333"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/></svg>');
}

.template-icon {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23333333"><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14z"/><path d="M7 12h2v5H7zm8-5h2v10h-2zm-4 7h2v3h-2zm0-4h2v2h-2z"/></svg>');
}

.user-avatar {
  width: 30px;
  height: 30px;
  background-color: #00bebd;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  cursor: pointer;
  position: relative;
}

.user-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  min-width: 120px;
  z-index: 10;
}

.user-menu a {
  display: block;
  padding: 8px 16px;
  color: #333;
  font-size: 14px;
  text-decoration: none;
}

.user-menu a:hover {
  background-color: #f5f5f5;
}

/* 搜索容器样式 */
.search-container {
  position: sticky;
  top: 0;
  z-index: 99;
  transition: all 0.3s ease;
  background-color: transparent;
  padding: 20px 0;
}

/* 滚动时的样式 */
.search-container.scrolled {
  background-color: #ffffff;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  padding: 25px 0;
  border-bottom: 1px solid rgba(0, 190, 189, 0.15);
}

/* 隐藏时的样式 */
.search-container.hidden {
  transform: translateY(-100%);
  opacity: 0;
}

/* 搜索包装器 */
.search-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  transition: all 0.3s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .search-container {
    padding: 12px 0;
  }

  .search-container.scrolled {
    padding: 8px 0;
  }

  .search-wrapper {
    padding: 0 15px;
  }
}

/* 平滑滚动效果 */
html {
  scroll-behavior: smooth;
}

/* 搜索框动画 */
.search-container {
  animation: fadeInDown 0.6s both;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 滚动时隐藏搜索框 */
.search-container.hidden {
  transform: translateY(-100%);
  opacity: 0;
}

/* 主体内容样式 */
.main-content {
  flex: 1;
  padding: px 0;
}

.job-categories-container {
  width: 100%;
  max-width: 1500px;
  margin: 30px auto;
  background-color: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: all 0.3s ease;
}

.job-categories-container:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.categories-wrapper {
  display: flex;
  min-height: 500px;
}

/* 左侧一级分类 */
.left-categories {
  width: 240px;
  background-color: #f9fafc;
  border-right: 1px solid #eaeef5;
  overflow-y: auto;
  transition: all 0.3s ease;
}

.level1-group {
  border-bottom: 1px solid #eaeef5;
}

.level1-title {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  font-size: 15px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
  position: relative;
}

.level1-title:hover {
  background-color: #f0f7ff;
  color: #00bebd;
}

.level1-title.active {
  background-color: #fff;
  color: #00bebd;
  border-left: 3px solid #00bebd;
  padding-left: 17px;
}

.level1-title.active::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: #fff;
  z-index: 2;
}

.level1-icon {
  width: 22px;
  height: 22px;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00bebd;
  font-size: 16px;
}

.level1-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arrow {
  width: 18px;
  text-align: center;
  transition: transform 0.3s ease;
  color: #999;
  font-size: 14px;
}

.rotate {
  transform: rotate(90deg);
}

/* 中间二级分类 */
.middle-categories {
  width: 240px;
  background-color: #fff;
  border-right: 1px solid #eaeef5;
  overflow-y: auto;
  transition: all 0.3s ease;
}

.level2-item {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.level2-item:hover {
  background-color: #f5f9ff;
  color: #00bebd;
}

.level2-item.active {
  color: #00bebd;
  font-weight: 500;
  background-color: #f0f7ff;
  border-left: 2px solid #00bebd;
  padding-left: 18px;
}

.level2-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 右侧内容区域 */
.right-content {
  flex: 1;
  padding: 24px;
  background-color: #fff;
  min-height: 500px;
  display: flex;
  flex-direction: column;
}

.breadcrumb {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  font-size: 14px;
  color: #888;
}

.breadcrumb-item {
  cursor: pointer;
  color: #666;
  transition: color 0.2s;
}

.breadcrumb-item:hover {
  color: #00bebd;
}

.breadcrumb-item.active {
  color: #333;
  font-weight: 500;
  cursor: default;
}

.breadcrumb-separator {
  margin: 0 8px;
  color: #ddd;
}

.content-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.content-title {
  font-size: 22px;
  color: #222;
  font-weight: 600;
  margin-bottom: 12px;
}

.level2-info {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #888;
}

.level2-info span {
  margin-right: 16px;
}

.divider {
  color: #eaeaea;
  margin-right: 16px;
}

/* 三级分类网格 */
.level3-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.level3-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 16px;
  border: 1px solid #eaeef5;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-decoration: none;
  background-color: #fff;
}

.level3-card:hover {
  border-color: #00bebd;
  box-shadow: 0 6px 16px rgba(0, 190, 189, 0.1);
  transform: translateY(-2px);
}

.level3-name-only {
  font-size: 14px;
  color: #444;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  transition: color 0.2s;
}

.level3-card:hover .level3-name-only {
  color: #00bebd;
}

/* 图片网格样式 */
.image-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 auto;
  width: 90%;
}
.image-item a {
  display: block;
  width: 100%;
  height: 100%;
}

.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-row {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.image-item {
  flex: 1;
  max-width: 50%;
  border-radius: 20px;
  box-shadow: 0 4px 120px rgba(212, 22, 22, 0.08);
  overflow: hidden;
  transition: all 0.3s ease;
  aspect-ratio: 19.1/9;
}

.image-item:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.image-item:hover img {
  transform: scale(1.05);
}

/* 加载和错误状态 */
.loading-content,
.error-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  flex: 1;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 190, 189, 0.1);
  border-top-color: #00bebd;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.error-content i {
  font-size: 40px;
  color: #f56c6c;
  margin-bottom: 16px;
}

.error-content p {
  font-size: 16px;
  color: #f56c6c;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 响应式设计 */
@media (max-width: 992px) {
  .categories-wrapper {
    flex-direction: column;
    min-height: auto;
  }

  .left-categories,
  .middle-categories {
    width: 100%;
    max-height: 300px;
    border-right: none;
    border-bottom: 1px solid #eaeef5;
  }

  .right-content {
    min-height: 400px;
  }

  .level3-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 768px) {
  .job-categories-container {
    margin: 20px auto;
    border-radius: 12px;
  }

  .right-content {
    padding: 16px;
  }

  .content-title {
    font-size: 20px;
  }

  .level3-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .image-grid {
    width: 100%;
  }

  .image-row {
    flex-direction: column;
  }

  .image-item {
    max-width: 100%;
  }
}

.image-item:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.image-item:hover img {
  transform: scale(1.05);
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
}

.loading-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

.error-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #f56c6c;
}

.error-content i {
  font-size: 36px;
  margin-bottom: 12px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 搜索结果样式 */
.search-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.search-title {
  font-size: 18px;
  color: var(--text-primary);
  font-weight: 500;
}

.result-count {
  font-size: 14px;
  color: var(--text-tertiary);
}

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.search-result-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  transition: all 0.2s;
  text-decoration: none;
  background-color: var(--bg-white);
}

.search-result-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.job-title {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-name {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.salary {
  font-size: 16px;
  color: var(--secondary-color);
  font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 992px) {
  .left-categories,
  .middle-categories {
    width: 180px;
    min-width: 180px;
  }

  .search-results-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  .boss-header .header-container {
    padding: 0 10px;
  }

  .main-nav {
    display: none;
  }

  .header-container {
    justify-content: space-between;
  }

  .city-selector-btn {
    margin-right: 15px;
  }

  .user-area {
    gap: 10px;
  }

  .job-categories-container {
    margin: 0 10px;
  }

  .categories-wrapper {
    flex-direction: column;
  }

  .left-categories,
  .middle-categories {
    width: 100%;
    max-width: none;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .image-row {
    flex-direction: column;
  }

  .image-item {
    max-width: 100%;
  }

  .right-content {
    padding: 16px;
  }

  .search-results-grid {
    grid-template-columns: 1fr;
  }
}

/* 热招职位区块优化样式 */
/* ==================== 热招职位容器 ==================== */
.job-category-section {
  max-width: 1280px;
  margin: 80px auto;
  padding: 40px;
  background: linear-gradient(135deg, #f9fcff 0%, #f0f7fa 100%);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.8);
  position: relative;
  overflow: hidden;
}

/* 装饰性背景元素 */
.job-category-section::before {
  content: "";
  position: absolute;
  top: -50px;
  left: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    rgba(0, 190, 189, 0.1) 0%,
    transparent 70%
  );
  z-index: 0;
}

.job-category-section::after {
  content: "";
  position: absolute;
  bottom: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    rgba(0, 190, 189, 0.1) 0%,
    transparent 70%
  );
  z-index: 0;
}

/* 标题样式 */
.job-category-section h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #222;
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 1;
  background: linear-gradient(90deg, #222, #444);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.5px;
}

/* 标题装饰线 */
.job-category-section h1::after {
  content: "";
  position: absolute;
  bottom: -1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, #00bebd, #00b26a);
  border-radius: 2px;
}

/* ==================== 分类导航 ==================== */
.category-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 1;
}

/* 分类按钮 */
.category-btn {
  position: relative;
  border-radius: 50px !important;
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
  padding: 10px 24px !important;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  background-color: rgba(255, 255, 255, 0.8) !important;
  color: #555 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
  backdrop-filter: blur(4px);
  overflow: hidden;
}

.category-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: all 0.6s ease;
}

.category-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1) !important;
  color: #333 !important;
}

.category-btn:hover::before {
  left: 100%;
}

.category-btn.active {
  background: linear-gradient(135deg, #00bebd, #00b26a) !important;
  color: white !important;
  border-color: transparent !important;
  box-shadow: 0 6px 20px rgba(0, 190, 189, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2) !important;
}

/* ==================== 职位列表 ==================== */
.job-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 8px;
  position: relative;
  z-index: 1;
}

/* 职位卡片 */
.job-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
}

/* 卡片悬停效果 */
.job-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12),
    inset 0 0 0 1px rgba(0, 190, 189, 0.2);
}

/* 职位信息区域 */
.job-info {
  padding: 28px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* 职位头部 */
.job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.job-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #222;
  line-height: 1.4;
  flex: 1;
}

.salary {
  font-size: 1.125rem;
  font-weight: 700;
  color: #ff6600;
  background: linear-gradient(90deg, #ff6600, #ff8c00);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-left: 12px;
  white-space: nowrap;
}

/* 职位元信息 */
.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
  font-size: 0.875rem;
  color: #666;
}

.job-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.job-meta .el-icon {
  font-size: 0.9375rem;
}

/* 公司信息 */
.company-info {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: auto;
  padding: 16px;
  background: rgba(0, 190, 189, 0.03);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.job-card:hover .company-info {
  background: rgba(0, 190, 189, 0.08);
}

.company-logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: white;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.job-card:hover .company-logo {
  transform: rotate(5deg) scale(1.05);
}

.company-details {
  flex: 1;
}

.company-name {
  font-size: 1rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 4px;
}

.company-details .job-meta {
  font-size: 0.8125rem;
  color: #777;
  margin: 0;
  gap: 8px;
}

/* 职位操作按钮 */
.job-actions {
  position: absolute;
  right: 24px;
  bottom: 24px;
  display: flex;
  gap: 12px;
  opacity: 0;
  transition: all 0.3s ease;
}

.job-card:hover .job-actions {
  opacity: 1;
}

.job-actions .el-button {
  border-radius: 50px !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  padding: 8px 20px !important;
  transition: all 0.3s ease !important;
}

.job-actions .el-button--primary {
  background: linear-gradient(135deg, #00bebd, #00b26a) !important;
  color: white !important;
  border: none !important;
}

.job-actions .el-button--warning {
  background: linear-gradient(135deg, #ffa500, #ff8c00) !important;
  color: white !important;
  border: none !important;
}

/* ==================== 查看更多按钮 ==================== */
.load-more-container {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  text-align: center;
  position: relative;
  z-index: 1;
}

.load-more-container .el-button {
  background: linear-gradient(135deg, #00bebd, #00b26a);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 16px 48px;
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(0, 190, 189, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.load-more-container .el-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.3),
    rgba(255, 255, 255, 0.1)
  );
  transform: translateX(-100%);
  transition: all 0.6s ease;
}

.load-more-container .el-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 190, 189, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.load-more-container .el-button:hover::before {
  transform: translateX(100%);
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1200px) {
  .job-category-section {
    margin: 60px 24px;
    padding: 32px;
  }

  .job-list {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .job-category-section {
    margin: 40px 16px;
    padding: 24px;
    border-radius: 16px;
  }

  .job-category-section h1 {
    font-size: 2rem;
    margin-bottom: 2rem;
  }

  .job-list {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .job-info {
    padding: 20px;
  }

  .company-logo {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 480px) {
  .job-category-section {
    margin: 32px 12px;
    padding: 20px;
  }

  .job-category-section h1 {
    font-size: 1.75rem;
  }

  .category-nav {
    gap: 8px;
  }

  .category-btn {
    padding: 8px 16px !important;
    font-size: 0.875rem !important;
  }

  .job-header {
    flex-direction: column;
    gap: 8px;
  }

  .salary {
    margin-left: 0;
    align-self: flex-start;
  }
}
.job-meta {
  color: #888;
  font-size: 14px;
  margin: 10px 0 14px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.job-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.company-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fafbfc;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 10px;
}
.company-logo {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
  border: 1px solid #eee;
}
.company-details {
  flex: 1;
}
.company-name {
  font-size: 15px;
  font-weight: 600;
  color: #222;
  margin-bottom: 2px;
}
.company-details .job-meta {
  font-size: 12px;
  color: #aaa;
  margin: 0;
}
.job-actions {
  position: absolute;
  right: 20px;
  bottom: 20px;
  display: flex;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.3s;
}
.job-card:hover .job-actions {
  opacity: 1;
}
.el-button {
  border-radius: 20px !important;
  font-size: 13px;
  padding: 4px 18px;
  transition: background 0.2s, color 0.2s;
}
.el-button--primary:hover {
  background: #00b26a !important;
  color: #fff !important;
}
.el-button--warning:hover {
  background: #ffb300 !important;
  color: #fff !important;
}
@media (max-width: 900px) {
  .job-list {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .job-card {
    padding: 0;
  }
}

/* 热门企业区块样式 */
/* ==================== 热门企业容器 ==================== */
.hot-jobs-container {
  max-width: 1280px;
  margin: 10px auto;
  padding: 40px;
  background: linear-gradient(135deg, #f9fcff 0%, #f0f7fa 100%);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.8);
  position: relative;
  overflow: hidden;
}

/* 装饰性背景元素 */
.hot-jobs-container::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    rgba(0, 190, 189, 0.1) 0%,
    transparent 70%
  );
  z-index: 0;
}

/* 标题样式 */
.hot-jobs-container h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #222;
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 1;
  background: linear-gradient(90deg, #222, #444);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.5px;
}

/* 标题装饰线 */
.hot-jobs-container h1::after {
  content: "";
  position: absolute;
  bottom: -1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, #00bebd, #00b26a);
  border-radius: 2px;
}

/* ==================== 企业网格布局 ==================== */
.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 32px;
  position: relative;
  z-index: 1;
}

/* 企业卡片 */
.company-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 卡片悬停效果 */
.company-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12),
    inset 0 0 0 1px rgba(0, 190, 189, 0.2);
}

/* ==================== 企业信息区域 ==================== */
.company-info {
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: linear-gradient(to right, rgba(0, 190, 189, 0.03), transparent);
}

/* 企业logo */
.company-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: white;
  padding: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.company-card:hover .company-logo {
  transform: rotate(5deg) scale(1.05);
}

/* 企业名称 */
.company-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 0.5rem;
  letter-spacing: -0.2px;
}

/* 企业标签容器 */
.company-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* 单个标签样式 */
.company-tags span {
  background: rgba(0, 0, 0, 0.04);
  color: #555;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.company-card:hover .company-tags span {
  background: rgba(0, 190, 189, 0.08);
  color: #007a78;
}

/* ==================== 职位列表 ==================== */
.job-list {
  padding: 20px 28px;
}

.job-item {
  padding: 18px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
}

.job-item:last-child {
  border-bottom: none;
}

.job-item:hover {
  background: rgba(0, 190, 189, 0.03);
}

/* 职位头部 */
.job-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.job-title {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-salary {
  font-size: 1rem;
  font-weight: 700;
  color: #ff6600;
  background: linear-gradient(90deg, #ff6600, #ff8c00);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 职位元信息 */
.job-meta {
  display: flex;
  gap: 12px;
  font-size: 0.8125rem;
  color: #777;
}

.job-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==================== 按钮样式 ==================== */
.btn-container {
  padding: 0 28px 24px;
  margin-top: 8px;
}

.view-more-btn {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid rgba(0, 190, 189, 0.3);
  color: #00bebd;
  border-radius: 8px;
  padding: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.view-more-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 190, 189, 0.1),
    transparent
  );
  transition: all 0.6s ease;
}

.view-more-btn:hover {
  background: rgba(0, 190, 189, 0.05);
  border-color: #00bebd;
}

.view-more-btn:hover::before {
  left: 100%;
}

/* 全局查看更多按钮容器 */
.global-btn-container {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  text-align: center;
}

.global-view-more {
  background: linear-gradient(135deg, #00bebd, #00b26a);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 16px 48px;
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(0, 190, 189, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.global-view-more::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.3),
    rgba(255, 255, 255, 0.1)
  );
  transform: translateX(-100%);
  transition: all 0.6s ease;
}

.global-view-more:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 190, 189, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.global-view-more:hover::before {
  transform: translateX(100%);
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1200px) {
  .hot-jobs-container {
    margin: 60px 24px;
    padding: 32px;
  }

  .company-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .hot-jobs-container {
    margin: 40px 16px;
    padding: 24px;
    border-radius: 16px;
  }

  .hot-jobs-container h1 {
    font-size: 2rem;
    margin-bottom: 2rem;
  }

  .company-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .company-info {
    padding: 20px;
    gap: 16px;
  }

  .company-logo {
    width: 60px;
    height: 60px;
  }

  .job-list {
    padding: 16px 20px;
  }
}

@media (max-width: 480px) {
  .hot-jobs-container {
    margin: 32px 12px;
    padding: 20px;
  }

  .hot-jobs-container h1 {
    font-size: 1.75rem;
  }

  .company-info {
    flex-direction: column;
    text-align: center;
    padding: 24px 20px;
  }

  .company-tags {
    justify-content: center;
  }

  .job-meta {
    flex-wrap: wrap;
    justify-content: center;
  }
}

.btn-container {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}
.view-more-btn {
  background-color: #fff;
  border: 1px solid #00b26a;
  color: #00b26a;
  border-radius: 20px;
  padding: 6px 18px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-more-btn:hover {
  background-color: #f8fff9;
  color: #009e5a;
}

.global-btn-container {
  display: flex;
  justify-content: center;
  margin-top: 40px;
  padding-bottom: 20px;
  border-top: 1px solid #f0f0f0;
}
.global-view-more {
  background-color: #00b26a;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 12px 30px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 178, 106, 0.2);
}
.global-view-more:hover {
  background-color: #009e5a;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 178, 106, 0.3);
}

@media (max-width: 992px) {
  .company-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .company-grid {
    grid-template-columns: 1fr;
  }
}
</style>
